import App from '../App'
// routerList.home = r => require.ensure([], () => r(require('../components/home/index')), 'home')

// const home = r => require.ensure([], () => r(require('../page/home/index')), 'home')
// const login = r => require.ensure([], () => r(require('../page/login/index')), 'login')
// const city = r => require.ensure([], () => r(require('../page/home/city')), 'city')
// const icenter = r => require.ensure([], () => r(require('../page/icenter/index')), 'icenter')
// const info = r => require.ensure([], () => r(require('../page/icenter/info')), 'info')
// const store = r => require.ensure([], () => r(require('../page/store')), 'store')
// const topList = r => require.ensure([], () => r(require('../page/icenter/toplist')), 'topList')
// const records = r => require.ensure([], () => r(require('../page/icenter/records')), 'records')
// const goods = r => require.ensure([], () => r(require('../page/icenter/goods/index')), 'goods')
// const deal = r => require.ensure([], () => r(require('../page/icenter/goods/deal')), 'deal')
// const exchange = r => require.ensure([], () => r(require('../page/icenter/exchange')), 'deal')
// const promotion = r => require.ensure([], () => r(require('../page/icenter/promotion')), 'promotion')
// const nofound = r => require.ensure([], () => r(require('../page/home/404')), 'nofound')
// const faq = r => require.ensure([], () => r(require('../page/home/faq')), 'faq')

export default [{
  path: '/',
  component: App, // 顶层路由，对应index.html
  children: [ // 二级路由。对应App.vue
    {
      path: '',
      redirect: '/default'
    }, {
      path: '/login',
      component: resolve => require(['../page/login/index'], resolve)
    }, {
      path: '/default',
      component: resolve => require(['../page/index'], resolve),  // 顶级页面 加载二级路由
      children: [
        {
          path: '',
          redirect: '/index'
        }, {
          path: '/index',
          component: resolve => require(['../page/home/index'], resolve),
          meta: {
            keepAlive: true
          }
        }, {
          path: '/index/:cityID',
          component: resolve => require(['../page/home/index'], resolve),
          meta: {
            keepAlive: true
          }
        }, {
          path: '/gameinfo', // 赚积分游戏详情
          component: resolve => require(['../page/home/info'], resolve)
        }, {
          path: '/city',
          component: resolve => require(['../page/home/city'], resolve)
        }, {
          path: '/icenter',
          component: resolve => require(['../page/icenter/index'], resolve),
          meta: {
            keepAlive: true
          }
        }, {
          path: '/info',
          component: resolve => require(['../page/icenter/info'], resolve)
        }, {
          path: '/toplist',
          component: resolve => require(['../page/icenter/toplist'], resolve)
        }, {
          path: '/goods', // 我的玩赚
          component: resolve => require(['../page/icenter/goods/index'], resolve)
        }, {
        //   path: '/deal', // 我的玩赚详情
        //   component: resolve => require(['../page/icenter/goods/deal'], resolve)
        // }, {
        //   path: '/deal/:id', // 我的玩赚详情
        //   component: resolve => require(['../page/icenter/goods/deal'], resolve)
        // }, {
          path: '/records', // 积分记录
          component: resolve => require(['../page/icenter/records'], resolve)
        }, {
          path: '/exchange', // 兑换记录
          component: resolve => require(['../page/icenter/exchange'], resolve)
        }, {
          path: '/olist', // 订单记录
          component: resolve => require(['../page/icenter/orderlist'], resolve)
        }, {
          path: '/store',
          component: resolve => require(['../page/store'], resolve)
        }, {
          path: '/promotion',
          component: resolve => require(['../page/icenter/promotion'], resolve)
        }, {
          path: '/faq',
          component: resolve => require(['../page/home/faq'], resolve)
        }, {
        //  path: '/games',
        //  component: resolve => require(['../page/games/index'], resolve)
        // }, {
          path: '/coupon',
          component: resolve => require(['../page/coupon/index'], resolve),
          meta: {
            keepAlive: true
          }
        }, {
          path: '/commision', // 佣金
          component: resolve => require(['../page/commision/index'], resolve),
          meta: {
            keepAlive: true
          }
        }, {
          path: '/comminfo', // 佣金商品详情页
          component: resolve => require(['../page/commision/detail'], resolve)
        }, {
          path: '/commrecord', // 佣金记录
          component: resolve => require(['../page/commision/records'], resolve)
        }, {
          path: '/recordetail', // 佣金记录
          component: resolve => require(['../page/commision/recordetail'], resolve)
        }, {
          path: '/wzinfo', // banner详情
          component: resolve => require(['../page/home/banner/wzinfo'], resolve)
        }, {
          path: '/pay', // 支付
          component: resolve => require(['../page/pay/index'], resolve)
        }, {
          path: '/address', // 添加地址
          component: resolve => require(['../page/pay/address'], resolve)
        }, {
          path: '/article', // 文章
          component: resolve => require(['../page/home/wzt/article'], resolve)
        }, {
          path: '/html5', // 外链
          component: resolve => require(['../page/home/wzt/html5'], resolve)
        }, {
          path: '/video', // 视频
          component: resolve => require(['../page/home/wzt/video'], resolve)
        }, {
          path: '/redpack', // 抢红包
          component: resolve => require(['../page/home/redpack'], resolve)
        }
      ]
    }
  ]
}, {
  path: '/*',
  component: resolve => require(['../page/404'], resolve)
}]
